package code.framework.android.activity;

import android.app.Activity;
import android.content.pm.ActivityInfo;
import android.view.Window;

/**
 * configure activity to different behaviour
 */
public class ActivityConfigurator {

	public static void determinateProcess(Activity activity) {
		activity.requestWindowFeature(Window.FEATURE_PROGRESS);
	}

	public static void inDeterminateProcess(Activity activity) {
		activity.requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
	}

	public static void setupDeterminateProcess(Activity activity) {
		activity.setProgressBarVisibility(true);
	}

	public static void setupInDeterminateProcess(Activity activity) {
		activity.setProgressBarIndeterminateVisibility(true);
	}

	/**
	 * fix screen protrait
	 * 
	 * @param activity
	 */
	public static void fixScreenProtrait(Activity activity) {
		activity
				.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
	}

}
